// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

// This code was generated by google-apis-code-generator 1.5.1

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Cloud Storage JSON API (storage/v1)
// Generated from:
//   Version: v1
//   Revision: 20171004
// Generated by:
//    Tool: google-apis-code-generator 1.5.1
//     C++: 0.1.5
#ifndef  GOOGLE_STORAGE_API_TEST_IAM_PERMISSIONS_RESPONSE_H_
#define  GOOGLE_STORAGE_API_TEST_IAM_PERMISSIONS_RESPONSE_H_

#include <string>
#include "googleapis/base/macros.h"
#include "googleapis/client/data/jsoncpp_data.h"
#include "googleapis/strings/stringpiece.h"

namespace Json {
class Value;
}  // namespace Json

namespace google_storage_api {
using namespace googleapis;

/**
 * A storage.(buckets|objects).testIamPermissions response.
 *
 * @ingroup DataObject
 */
class TestIamPermissionsResponse : public client::JsonCppData {
 public:
  /**
   * Creates a new default instance.
   *
   * @return Ownership is passed back to the caller.
   */
  static TestIamPermissionsResponse* New();

  /**
   * Standard constructor for an immutable data object instance.
   *
   * @param[in] storage  The underlying data storage for this instance.
   */
  explicit TestIamPermissionsResponse(const Json::Value& storage);

  /**
   * Standard constructor for a mutable data object instance.
   *
   * @param[in] storage  The underlying data storage for this instance.
   */
  explicit TestIamPermissionsResponse(Json::Value* storage);

  /**
   * Standard destructor.
   */
  virtual ~TestIamPermissionsResponse();

  /**
   * Returns a string denoting the type of this data object.
   *
   * @return <code>google_storage_api::TestIamPermissionsResponse</code>
   */
  const char* GetTypeName() const {
    return "google_storage_api::TestIamPermissionsResponse";
  }

  /**
   * Determine if the '<code>kind</code>' attribute was set.
   *
   * @return true if the '<code>kind</code>' attribute was set.
   */
  bool has_kind() const {
    return Storage().isMember("kind");
  }

  /**
   * Clears the '<code>kind</code>' attribute.
   */
  void clear_kind() {
    MutableStorage()->removeMember("kind");
  }


  /**
   * Get the value of the '<code>kind</code>' attribute.
   */
  const StringPiece get_kind() const {
    const Json::Value& v = Storage("kind");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>kind</code>' attribute.
   *
   * The kind of item this is.
   *
   * @param[in] value The new value.
   */
  void set_kind(const StringPiece& value) {
    *MutableStorage("kind") = value.data();
  }

  /**
   * Determine if the '<code>permissions</code>' attribute was set.
   *
   * @return true if the '<code>permissions</code>' attribute was set.
   */
  bool has_permissions() const {
    return Storage().isMember("permissions");
  }

  /**
   * Clears the '<code>permissions</code>' attribute.
   */
  void clear_permissions() {
    MutableStorage()->removeMember("permissions");
  }


  /**
   * Get a reference to the value of the '<code>permissions</code>' attribute.
   */
  const client::JsonCppArray<string > get_permissions() const {
     const Json::Value& storage = Storage("permissions");
    return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
  }

  /**
   * Gets a reference to a mutable value of the '<code>permissions</code>'
   * property.
   *
   * The permissions held by the caller. Permissions are always of the format
   * storage.resource.capability, where resource is one of buckets or objects.
   * The supported permissions are as follows:
   * - storage.buckets.delete — Delete bucket.
   * - storage.buckets.get — Read bucket metadata.
   * - storage.buckets.getIamPolicy — Read bucket IAM policy.
   * - storage.buckets.create — Create bucket.
   * - storage.buckets.list — List buckets.
   * - storage.buckets.setIamPolicy — Update bucket IAM policy.
   * - storage.buckets.update — Update bucket metadata.
   * - storage.objects.delete — Delete object.
   * - storage.objects.get — Read object data and metadata.
   * - storage.objects.getIamPolicy — Read object IAM policy.
   * - storage.objects.create — Create object.
   * - storage.objects.list — List objects.
   * - storage.objects.setIamPolicy — Update object IAM policy.
   * - storage.objects.update — Update object metadata.
   *
   * @return The result can be modified to change the attribute value.
   */
  client::JsonCppArray<string > mutable_permissions() {
    Json::Value* storage = MutableStorage("permissions");
    return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
  }

 private:
  void operator=(const TestIamPermissionsResponse&);
};  // TestIamPermissionsResponse
}  // namespace google_storage_api
#endif  // GOOGLE_STORAGE_API_TEST_IAM_PERMISSIONS_RESPONSE_H_
